$(function(){
    
    function getId(){
        return location.hash.split("=")[1];
    }
    window.onload=function(){
       
        huoqu()
        .done(function(data){
             console.log(data);
             xuanran(data,data.data)
             fdj();
        })
    }
    function huoqu(id){
        let options ={
            url:"http://127.0.0.1:8080/static/data/list.json",
            type:"GET",
            // data:{
            //     id:id
            // },
            dataType:"json"
        }
        // console.log(options);
        return $.ajax(options)
    }
    
    function xuanran(data){     
        let btn = document.querySelector(".btn")   
        let big_img = document.querySelector(".big-img ") 
        let min_img= document.querySelector(".min_img")
        let logo = document.getElementById("logo")

        btn.innerHTML = `
        <div class="focus"></div>
        <img src="${data.data[location.hash.split("=")[1]-1].img}" alt="">
        `
      big_img.innerHTML = `<img id="logo" src="${data.data[location.hash.split("=")[1]-1].img}" alt="" >`
        min_img.innerHTML=
        `
        <ul id="lunboUl">
                <li class="cur">
                    <img src="${data.data[location.hash.split("=")[1]-1].samll_img1}" style="width:55px;height:55px;" class="goodsImg">
                </li>
                <li class="cur">
                    <img src="${data.data[location.hash.split("=")[1]-1].samll_img2}" style="width:55px;height:55px;" class="goodsImg">
                </li>
                <li class="cur">
                    <img src="${data.data[location.hash.split("=")[1]-1].samll_img3}" style="width:55px;height:55px;" class="goodsImg">
                </li>
                <li class="cur">
                    <img src="${data.data[location.hash.split("=")[1]-1].samll_img4}" style="width:55px;height:55px;" class="goodsImg">
                </li>
                <li class="cur">
                    <img src="${data.data[location.hash.split("=")[1]-1].samll_img1}" style="width:55px;height:55px;" class="goodsImg">
                </li>
            </ul>
        `
    }


        
 
})
